/* Copyright 2021 The Chromium Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file. */

/*
Use these custom properties to control the feature toasts, for example:

#my-new-feature-button {
  --ripple-start-height: 20px;
  --ripple-start-width: 54px;

  --toast-ref-x: right;
  --toast-element-ref-x: right;
  --toast-offset-x: 0;

  --toast-ref-y: bottom;
  --toast-element-ref-y: top;
  --toast-offset-y: -30px;

  --indicator-dot-ref-x: left;
  --indicator-dot-element-ref-x: center;
  --indicator-dot-offset-x: 0px;

  --indicator-dot-ref-y: bottom;
  --indicator-dot-element-ref-y: top;
  --indicator-dot-offset-y: -14px;
}
*/

@property --ripple-start-width {
  syntax: '<length>';
  inherits: false;
  initial-value: 0;
}

@property --ripple-start-height {
  syntax: '<length>';
  inherits: false;
  initial-value: 0;
}

@property --toast-ref-x {
  syntax: 'left | right';
  inherits: false;
  initial-value: left;
}

@property --toast-ref-y {
  syntax: 'bottom | top';
  inherits: false;
  initial-value: bottom;
}

@property --toast-element-ref-x {
  syntax: 'left | right | center';
  inherits: false;
  initial-value: right;
}

@property --toast-element-ref-y {
  syntax: 'bottom | top | middle';
  inherits: false;
  initial-value: top;
}

@property --toast-offset-x {
  syntax: '<length>';
  inherits: false;
  initial-value: 0;
}

@property --toast-offset-y {
  syntax: '<length>';
  inherits: false;
  initial-value: 0;
}

@property --indicator-dot-ref-x {
  syntax: 'left | right';
  inherits: false;
  initial-value: left;
}

@property --indicator-dot-ref-y {
  syntax: 'bottom | top';
  inherits: false;
  initial-value: bottom;
}

@property --indicator-dot-element-ref-x {
  syntax: 'left | right | center';
  inherits: false;
  initial-value: right;
}

@property --indicator-dot-element-ref-y {
  syntax: 'bottom | top | middle';
  inherits: false;
  initial-value: top;
}

@property --indicator-dot-offset-x {
  syntax: '<length>';
  inherits: false;
  initial-value: 0;
}

@property --indicator-dot-offset-y {
  syntax: '<length>';
  inherits: false;
  initial-value: 0;
}

.custom-toast {
  align-items: center;
  background-color: var(--blue-300);
  border-radius: 18px;
  display: flex;
  padding: 8px 16px 8px 16px;
  position: fixed;
  white-space: nowrap;
}

.custom-toast-text {
  color: var(--grey-900);
  font: normal 400 13px/20px Roboto;
}

#new-feature-toast::before {
  content: url(/images/new_feature_toast_icon.svg);
  display: inline-block;
  margin-inline: 0 8px;
}

#indicator-toast div {
  --icon-size: 20px;

  align-items: center;
  display: flex;
  height: var(--icon-size);
  justify-content: center;
  margin-inline: 0 8px;
  width: var(--icon-size);
}

#indicator-icon {
  display: inline-block;
}

#indicator-dot {
  --dot-size: 8px;

  background-color: var(--blue-300);
  border-radius: 50%;
  height: var(--dot-size);
  position: absolute;
  transform: translate(-50%, -50%);
  width: var(--dot-size);
}

@keyframes ripple-scale {
  0% {
    transform: scale(0);
  }

  100% {
    transform: scale(3);
  }
}

@keyframes ripple-opacity {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

.ripple {
  --duration: 2s;

  background: white;
  border-radius: var(--border-radius-rounded-with-short-side);
  opacity: 0;
  pointer-events: none;
  position: fixed;
  transform-origin: center;
}

.ripple.animate {
  animation: ripple-scale var(--duration) cubic-bezier(0.4, 0, 0, 1), ripple-opacity var(--duration) cubic-bezier(0, 0, 0.4, 1);
}
